<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>namebench results: {{ id }}</title>
  <link href="/media/report.css" rel="stylesheet" type="text/css" />
  
  <script type='text/javascript' src='http://www.google.com/jsapi'></script>
  <script type='text/javascript'>
    google.load('visualization', '1', {packages:['table']});
    google.setOnLoadCallback(drawGoogIndexTable);
    google.setOnLoadCallback(drawWikiIndexTable);
    google.setOnLoadCallback(drawPortBehaviorTable);
    function drawGoogIndexTable() {
      var data = new google.visualization.DataTable();
      data.addColumn('string', 'Nameserver');
      data.addColumn('number', 'Time');
      data.addColumn('number', 'TTL');
      data.addColumn('string', 'Response');
      data.addRows([{{ goog_index_data }}]);
      var table = new google.visualization.Table(document.getElementById('goog_index_table'));
      table.draw(data, {allowHtml: true});
    }
    function drawWikiIndexTable() {
      var data = new google.visualization.DataTable();
      data.addColumn('string', 'Nameserver');
      data.addColumn('number', 'Time');
      data.addColumn('number', 'TTL');
      data.addColumn('string', 'Response');
      data.addRows([{{ wiki_index_data }}]);
      var table = new google.visualization.Table(document.getElementById('wiki_index_table'));
      table.draw(data, {allowHtml: true});
    }
  </script> 
</head>
<body>

<div id="container">
<div class="version">namebench {{ version }}</div>
<div id="big_summary" class="greybox">
{% ifequal best_nameserver.ip submission.primary_nameserver.ip %}
  Your primary DNS server
  <h4><strong>{{ best_nameserver.ip|escape }}</strong></h4>
  Is already the fastest.
{% else %}
	<h4><strong>{{ best_nameserver.name|escape }}</strong> is</h4>
	{% if best_improvement %}
  	<h1>{{ best_improvement|floatformat }}%</h1><h5 class="faster">Faster</h5>
  {% else %}
    <h1>N/A<h1>
  {% endif %}
  <h4>than {% ifequal reference.sys_position 0 %}your current primary DNS server{% else %}{{ reference.name }}{% endifequal %}</h4>
{% endifequal %}
</div>

<div id="recommended_config" class="greybox">
	<h4>Recommended configuration (fastest + nearest)</h4>
	<table>
	{% for ns in recommended %}
	<tr>
	  <td>{% ifequal forloop.counter 1 %}Primary{% endifequal %}
	      {% ifequal forloop.counter 2 %}Secondary{% endifequal %}
	      {% ifequal forloop.counter 3 %}Tertiary{% endifequal %} Server</td>
    <td><div class="ip">{{ ns.ip|escape }}</div></td><td class="rec_name">{{ ns.name|escape }}</td>
	</tr>
  {% endfor %}
  </table>
</div>

<h2>Tested DNS Servers</h2>

<div id="nsdetails">
<table id="nstable">
<thead>
<tr>
  <td nowrap="nowrap">IP</td>
  <td>Descr.</td>
  <td nowrap="nowrap">Hostname</td>
  <td nowrap="nowrap">Avg</td>
  <td nowrap="nowrap">Diff</td>
	<td nowrap="nowrap">Min</td>
	<td nowrap="nowrap">Max</td>
  <td nowrap="nowrap">TO</td>
  <td nowrap="nowrap">NX</td>
  <td>Notes</td>
</tr>
</thead>

{% for sub in nsdata %}
<tr class="{% if sub.is_disabled %}disabled{% else %}normal {% cycle odd,even %}{% endif %}{% ifequal sub.sys_position 0 %} primary_row{% endifequal %}{% if sub.is_error_prone %} unhealthy_host{% endif %}">
  <td class="ip_cell"><a href="http://www.google.com/search?q={{ sub.ip|escape}}" class="info">{{ sub.ip|escape }}{% if sub.version %}<span>{{ sub.version|escape }}</span>{% endif %}</td>
  <td class="name_cell">{{ sub.name|escape }}</td>
  <td class="hostname_cell"><a href="http://www.google.com/search?q={{ sub.hostname|escape}}" class="info">{{ sub.hostname|escape }}{% if sub.node_ids %}<span>{% for node in sub.node_ids %}{{ node|escape }} {% endfor %}</span>{% endif %}</a></td>
  <td>{% if sub.overall_average %}{{ sub.overall_average|floatformat }}{% else %}~{{ sub.check_average|floatformat }}{% endif %}</td>
  <td>{% if sub.diff %}{{ sub.diff|floatformat }}%{% endif %}</td>  
  <td>{% if sub.duration_min %}{{ sub.duration_min|floatformat }}{% endif %}</td>
  <td>{% if sub.duration_max %}{{ sub.duration_max|floatformat }}{% endif %}</td>
  <td {% if sub.timeout_count %}class="error_count"{% endif %}>{{ sub.timeout_count }}</td>
  <td>{% ifnotequal sub.nx_count None %}{{ sub.nx_count }}{% endifnotequal %}</td>
  <td class="notes_cell">
  {% if sub.notes %}
    <ul class="warnings">
		{% for note in sub.notes %}
		  <li>{% if note.url %}<a href="{{ note.url }}">{% endif %}{{ note.text }}{% if note.url %}</a>{% endif %}</li>
    {% endfor %}
	</ul>
  {% endif %}
  </td>
</tr>
{% endfor %}
</table>
</div>

<h2>Graphs</h2>

<ul>
  {% for row in fastest_data %}
  {{ row }}
  {% endfor %}
</ul>

<div id="graphs" class="section">
<h2>Mean Response Duration</h2>
<img src="{{ mean_duration_url }}" alt="Mean Duration Graph" />

<h3>Fastest Individual Response Duration</h3>
<img src="{{ min_duration_url }}" alt="Fastest Response Graph" />

<h3>Response Distribution Chart (First 250ms)</h3>

<img src="{{ distribution_url_250 }}" alt="Response Distribution Graph (first 250ms)" />

<h2>Sample Index Results (www.wikipedia.org)</h2>

<div id="wiki_index_table"></div>

<h2>Sample Index Results (www.google.com)</h2>

<div id="goog_index_table"></div>

<h2>Config</h2>

<div class="config" class="section">
<table class="configtable">
	<thead><tr><td>Name</td><td>Value</td></tr></thead>
	{% for row in config %}
	<tr><td>{{ row.0|escape }}</td><td>{{ row.1|escape }}</td></tr>
  {% endfor %}
	</table>
</div>

<h2>Location</h2>

<div class="config" class="section">
<table class="configtable">
	<thead><tr><td>Name</td><td>Value</td></tr></thead>
	<tr><td>Country</td><td>{{ submission.country|escape }}</td></tr>
	<tr><td>Region</td><td>{{ submission.region|escape }}</td></tr>
	<tr><td>City</td><td>{{ submission.city|escape }}</td></tr>
	<tr><td>Network</td><td>{{ submission.class_c|escape }}.0/24</td></tr>
	</table>
</div>


</div>
</body>
</html>
